<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>

<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>产品条形码导入</title>
<%@ include file="../../common/Style.jsp"%>
<script>
$(document).ready(function(){

	parent.$.messager.progress('close'); 

});
function saveConf(){
	if ( $('#qxbabyConfForm').form('validate')){
	   var params = $('#qxbabyConfForm').serialize();
	   $.post("<%=request.getContextPath()%>/actionChain/chainMgmtJSON!updateQxbabyConf",params, backProcessUpdateConf,"json");
	}
}
function backProcessUpdateConf(data){
	var returnCode = data.returnCode;
	if (returnCode == SUCCESS)
	   $.messager.alert('信息', '成功更新','info');
	else
	   $.messager.alert('更新失败', data.message,'error');
}
$.extend($.fn.validatebox.defaults.rules, {
	validateConfValue: {
        validator: function(value,param){
            if (value.trim().length != 0){
            	var guize = /^\d+(?:,\d+)*$/;
            	return guize.test(value);
            }
            return true;
        },
        message: '配置值有错误,格式示例1或者 2,3,4'
    }
});
</script>

</head>
<body>
					<div class="errorAndmes">
						<s:actionerror cssStyle="color:red" />
						<s:actionmessage cssStyle="color:blue" />
					</div>
	<s:form id="qxbabyConfForm" action="" method="POST" theme="simple">
	<table width="95%" align="center"  class="OuterTable">
	    <tr><td>
		   <table width="60%" border="0" class="OuterTable">
			<tr class="PBAOuterTableTitale">
				<th height="19" width="15%">配置ID</th>
				<th width="15%">配置值</th>
				<th>备注</th>
			</tr>

			<tbody id="orderTablebody">
				<s:iterator value="formBean.qxbabyConfs" status="st" id="conf">
					<tr class="InnerTableContent">
						<td height="19"><input type="text" class="easyui-textbox" name="formBean.qxbabyConfs[<s:property value="#st.index"/>].parmKey"
													id="parmKey<s:property value="#st.index"/>" size="13"
													value="<s:property value="#conf.parmKey"/>"/></td>
						<td><input type="text" class="easyui-textbox"  name="formBean.qxbabyConfs[<s:property value="#st.index"/>].value"
													id="parmKey<s:property value="#st.index"/>" size="13"
													value="<s:property value="#conf.value"/>" validtype="validateConfValue"/>
						</td>
						<td><input type="text" class="easyui-textbox"  name="formBean.qxbabyConfs[<s:property value="#st.index"/>].comment"
													id="parmKey<s:property value="#st.index"/>" size="40"
													value="<s:property value="#conf.comment"/>"  data-options="validType:['length[0,40]']"/>
					   </td>
					</tr>
					</s:iterator>
			</tbody>
			<tr class="InnerTableContent">
					<td height="30">&nbsp;</td>
					<td>
						<a id="btn" href="#" onclick="saveConf();" class="easyui-linkbutton" data-options="">保存配置信息</a>
					</td>
					<td></td>
			</tr>
		</table>
		</td>
		</tr>
		</table>
	</s:form>

</body>
</html>